<template>
    <div class="child">
        <h3>子组件</h3>
        <h5>玩具: {{ toy }}</h5>
        <h5>父给子的消息: {{ msg }}</h5>
        <button @click="sendToy(toy)">发送玩具</button>
    </div>
</template>

<script setup>
import { ref } from 'vue'
let toy = ref('变形金刚')

// 声明接受props
defineProps(['msg', 'sendToy'])
</script>

<style  scoped>
.child {
    padding: 10px;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
    background-color: skyblue;
    border-radius: 10px;
}
</style>